package com.example.mybatisplus.model.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 这是学生申请初访时填写的自测问卷的情况
 * </p>
 *
 * @author cft
 * @since 2022-06-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pcs_que_result")
@ApiModel(value="QueResult对象", description="这是学生申请初访时填写的自测问卷的情况")
public class QueResult extends Model<QueResult> {

    private static final long serialVersionUID = 1L;

    @TableId("user_id")
    private Long userId;
    @TableField("f_apo_id")
    private Long fApoId;
    @TableField("que_1")
    private String que1;
    @TableField("que_2")
    private String que2;
    @TableField("que_3")
    private String que3;
    @TableField("que_4")
    private String que4;
    @TableField("que_5")
    private String que5;
    @TableField("que_6")
    private String que6;
    @TableField("que_7")
    private String que7;
    @TableField("que_8")
    private String que8;
    @TableField("que_9")
    private String que9;
    @TableField("que_10")
    private String que10;
    @TableField("que_result")
    private Long queResult;

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

    public void sum(){
        this.queResult=0L;
        queResult+=Integer.parseInt(que1);
        queResult+=Integer.parseInt(que2);
        queResult+=Integer.parseInt(que3);
        queResult+=Integer.parseInt(que4);
        queResult+=Integer.parseInt(que5);
        queResult+=Integer.parseInt(que6);
        queResult+=Integer.parseInt(que7);
        queResult+=Integer.parseInt(que8);
        queResult+=Integer.parseInt(que9);
        queResult+=Integer.parseInt(que10);
    }

}
